package com.wbz.behavioral.strategy.strategy.impl;

import com.wbz.behavioral.strategy.strategy.DiscountStrategy;

/**
 * 百分比折扣策略
 */
public class PercentageDiscountStrategy implements DiscountStrategy {
    private final double discountPercentage;

    public PercentageDiscountStrategy(double discountPercentage) {
        this.discountPercentage = discountPercentage;
    }

    @Override
    public double applyDiscount(double originalPrice) {
        return originalPrice * (1 - discountPercentage / 100);
    }
}
